package com.jboltai.event.text;


import com.jboltai.capability.text.TextExtractResult;
import com.jboltai.event.EventType;
import com.jboltai.event.handler.TextExtractEventHandler;

import java.io.File;



/**
 * 文字内容提取事件
 */
public class TextExtractEvent extends TextEvent<TextExtractEvent, TextExtractResult, TextExtractEventHandler> {

    public TextExtractEvent(File file) {
        super(EventType.TEXT_EXTRACT);
        this.file = file;
    }
    public TextExtractEvent(String url) {
        super(EventType.TEXT_EXTRACT);
        this.url = url;
    }



    @Override
    public String preCheck() {
        if (file == null && url == null) {
            return "未指定文件或url,无法执行";
        }
        return null;
    }


}
